<template>
    <div class="">
        <div class="accountPos">
            <span>基本信息</span>
        </div>
        <div class="infoBox">
            <ul>
                <li>
                    <p>手机号：</p>
                    <div v-text="telephone"></div>
                </li>
                <li>
                    <p>借款人类型：</p>
                    <div>{{ information.type===1 ? '个人': '公司' }}</div>
                </li>
                <li>
                    <p>借款人姓名：</p>
                    <div v-text="information.name"></div>
                </li>
                <li>
                    <p>借款人身份证：</p>
                    <div v-text="information.idNo"></div>
                </li>
                <li>
                    <p>开户支行：</p>
                    <div v-text="information.branch"></div>
                </li>
                <li>
                    <p>个人介绍：</p>
                    <div v-text="information.profile"></div>
                </li>
                <li>
                    <p>相关凭证：</p>
                    <div>
                        <span v-for="photoImg in photoImgs">
                            <a href="javascript:void(0);"><img :src="photoImg.fileUrl"></a>
                        </span>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
    import Api from '../api/api'
    const api = new Api();
    export default {
        data(){
            return {
                information: '',
                telephone: localStorage.getItem('telephone'),
                photoImgs: ''
            }
        },
        created(){
            let param = {
                token: sessionStorage.getItem('token')
            }
            api.getHeaderInfo(param).then(res=>{
                if(res.data.success){
                    this.information = res.data.data.financier
                    this.photoImgs = res.data.data.file
                }else{
                    console.log(`个人信息接口请求失败！${res.data.cause}`)
                }
            }).catch(err=>{
                console.log(err)
            })
        }
    }
</script>